﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace csharp_base64
{
    class Base64
    {
        public static string Base64Encode(string src, System.Text.Encoding enc)
        {
            byte[] arr = enc.GetBytes(src);
            return Convert.ToBase64String(arr);
        }

        public static string Base64Decode(string src, System.Text.Encoding enc)
        {
            byte[] arr = Convert.FromBase64String(src);
            return enc.GetString(arr);
        }
    }
}
